<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@page import="java.sql.*, java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Choose University</title>
</head>
<body>

<% 
	
	ResultSet rset;
	rset = (ResultSet) request.getAttribute("crsUnis");;
	Vector<String> universities = new Vector<String>();
	Vector<String> universityID = new Vector<String>();
	while(rset.next())
	{
		universityID.add(rset.getString("id"));
		universities.add(rset.getString("name"));
	}
	
	
	
%>

	<c:forEach items="${formData}" var="line">
		<c:out value="${line}" /><br>
	</c:forEach>
	<br>
	<br>
	
	From which university did you receive your degree?<br>
	
	
	<div id="left_wrapper">
	<div id="left">
	<p>
	            
	<%
	for (int i=0; i<universities.size()/3; i++)
	{%>	          
	
	  	<html:link action="/pages/students/degreeUniversity">
			<html:param name="universityID" value="<%= universityID.get(i) %>" />
			<html:param name="degreeUniversity" value="<%= universities.get(i) %>" />
			<%= universities.get(i) %>
		</html:link>
		<br>          
	
	<% } %>
	</p>
	</div>
	</div>
	        	
	        	
	<div id="middle_wrapper"> 
	<div id="left">
	<p>
	            
	<%
	for(int i = universities.size()/3; i < 2 * (universities.size()/3); i++)
	{%>
		<html:link action="/pages/students/degreeUniversity">
			<html:param name="universityID" value="<%= universityID.get(i) %>" />
			<html:param name="degreeUniversity" value="<%= universities.get(i) %>" />
			<%= universities.get(i) %>
		</html:link>
		<br> 
	<%}%>
	            
	</p>
	</div>
	</div>
	        	
	<div id="right_wrapper"> 
	<div id="right">
	<p>
	        	
	<%
	for(int i = 2* (universities.size()/3); i < universities.size(); i++)
	{%>
	  	<html:link action="/pages/students/degreeUniversity">
			<html:param name="universityID" value="<%= universityID.get(i) %>" />
			<html:param name="degreeUniversity" value="<%= universities.get(i) %>" />
			<%= universities.get(i) %>
		</html:link>
		<br> 
	<%} %>
	        	
	</p>
	</div>
	</div>
	        	
<br>
<br>
<html:form action="/addUniversity">
	        	
Other University:<input type="text" name="otherUniversity" /><input type="submit" value="Submit"/>

</html:form>
		


<br><br>


</body>
</html>